#include <stdio.h>

struct person {
    char name[32];
    char sex;
    int  age;
    int  height;
    float  weight;
    void (*plus)(int, int);
};

void plus(int a, int b) {
    printf("a + b = %d\n", a + b);
}


void show_person(struct person *p);
void input_func(char *ask, void *item);

int main(int argc, char *argv[])
{
    struct person new_man;
    new_man.plus = plus;
    struct person *p = &new_man;

    new_man.plus(34, 48);

#if 0
    printf("please input your name:");
    scanf("%s", p->name);
    getchar();


    printf("please input your sex(m/w):");
    scanf("%c", &p->sex);
    getchar();

    printf("please input your age:");
    scanf("%d", &p->age);
    getchar();


    printf("please input your height:");
    scanf("%d", &p->height);
    getchar();

    printf("please input your weight:");
    scanf("%f", &p->weight);
    getchar();

    show_person(p);
#endif

    return 0;
}

// 打印信息
void show_person(struct person *p)
{
    printf("name: %s\n", p->name);
    printf("age: %d\n", p->age);
    printf("sex: %c\n", p->sex);
    printf("height: %d\n", p->height);
    printf("weight: %.2f\n", p->weight);
}



